//文件的重命名
import java.io.File;
import java.io.IOException;
public class Demo8 {
    public static void main(String[] args) throws IOException{
        File file = new File("some-file.txt");        
        File dest = new File("dest.txt");   // 
    
        System.out.println(file.exists());
        System.out.println(dest.exists());
        System.out.println(file.createNewFile());
        System.out.println(file.exists());
        System.out.println(file.renameTo(dest));
        System.out.println(file.exists());
        System.out.println(dest.exists());
    }
}
